﻿

using Glorysoft.EAP.Core.Enums;

namespace Glorysoft.EAP.Core.Entities
{
    public class TransformationChecktexTtype
    {
        public static  string TransToString(int checkTextType)
        {
            switch (checkTextType)
            {
                case (int)ChecktexTtypeEnum.TEXT:
                    return ChecktexTtypeEnum.TEXT.ToString();
                   
                case (int)ChecktexTtypeEnum.COMBO:
                    return ChecktexTtypeEnum.COMBO.ToString();
                   
                case (int)ChecktexTtypeEnum.RADIO:
                    return ChecktexTtypeEnum.RADIO.ToString();
                   
                default:
                    return "";
                   
            }
        }
        public static int TransToInt(string checkTextType)
        {

            if (checkTextType.ToUpper().Equals(ChecktexTtypeEnum.TEXT.ToString()))
            {
                return (int)ChecktexTtypeEnum.TEXT;
            }
            else if (checkTextType.ToUpper().Equals(ChecktexTtypeEnum.COMBO.ToString()))
            {
                return (int)ChecktexTtypeEnum.COMBO;
            }
            else if (checkTextType.ToUpper().Equals(ChecktexTtypeEnum.RADIO.ToString()))
            {
                return (int)ChecktexTtypeEnum.RADIO;
            }
            else {
                return -1;
            }

            
        }
    }
}
